/*
 * Copyright 2013 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.util;

//简单描述一下：
//如果一个对象有引用，那么计数器就+1
//如果释放了引用，那就计数器-1，
// 如果发现计数器是0了，那就执行回收。
//一般的对内的内存可以由GC来回收，但是如果是对外内存的话，就要自己手动来释放了，不然会造成内存泄漏
//touch方法其实就是辅助调试用的，另外就是引用计数的增加  retail  和 减少  release 。
public interface ReferenceCounted {
    int refCnt();

    ReferenceCounted retain();

    ReferenceCounted retain(int increment);

    ReferenceCounted touch();

    ReferenceCounted touch(Object hint);

    boolean release();

    boolean release(int decrement);
}
